#from Numeric import zeros
import random

class PositionMatrix(object):
	def __init__(self):
		self.numCols = 10
		self.numRows = 9
		self.cellWidth = 102
		self.cellHeight = 85
		self.posMat = []
		self.chooseList = []
		random.seed()
		for i in range(self.numCols):
			self.posMat.append([])
			for j in range(self.numRows):
				self.chooseList.append((i, j))
				self.posMat[i].append(0)

	def getRandPosition(self):
		found = False
		randCol = 0
		randRow = 0
		randPos = (9, 8)
		if len(self.chooseList) > 0:
			randPos = random.choice(self.chooseList)
			self.chooseList.remove(randPos)
		else:
			self.chooseList = []
			for i in range(self.numCols):
				self.posMat.append([])
				for j in range(self.numRows):
					self.chooseList.append((i, j))
			randPos = random.choice(self.chooseList)
			self.chooseList.remove(randPos)
		# Calculate position based on randRow and randCol
		xPos = self.cellWidth * randPos[0]
		yPos = self.cellHeight * randPos[1]
		return (xPos, yPos)


if __name__ == "__main__":
	posMatrix = PositionMatrix()
	print posMatrix.posMat
